package com.ssm.demo.common.utils;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class SPLog {
    private String logTime;
    /**
     * sql语句
     */
    private String sql;
    /**
     * id
     */
    private Integer dsId;

    public String getLogTime() {
        return logTime;
    }

    public void setLogTime(String logTime) {
        this.logTime = logTime;
    }

    public String getSql() {
        return sql;
    }

    public void setSql(String sql) {
        this.sql = sql;
    }

    public Integer getDsId() {
        return dsId;
    }

    public void setDsId(Integer dsId) {
        this.dsId = dsId;
    }

    /**
     * 构造方法，读取日志id和sql数据库语句
     * @param sql
     * @param dsId
     */
    public SPLog(String sql, Integer dsId) {
        this.logTime = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
        this.sql = sql;
        this.dsId = dsId;
    }
}
